# 不可变
tupleA = ()
print(id(tupleA))
tupleA = (1,2,3,'啊啊','哈哈')
print(id(tupleA))
print(type(tupleA))

tupleB = (0,1,2,3,4,5,6,7)
# 倒数 最后一个表示间隔  print(数组[起始位置:结束位置:间隔])
print(tupleB[::2])
print(tupleB[::-1])
print(tupleB[::-2])
print(tupleB[::-3])


#字段

dictA = {'name':18,'age':18}
print(dictA['name'])
print(type((dictA.keys())))
print(dictA.values())
print(dictA.items())

for s in  dictA:
    print(s)
    print(dictA[s])

for key,value in dictA.items():
    print(key)
    print(value)

dictA.update({'high':'180'})  # 添加或更新
del dictA['name']
print(dictA)

#排序


tupleC = ('a','b','c')
tupleD = ('a','b','c')
print(id(tupleC))
tupleC = tupleC + tupleD
print(tupleC)
print(id(tupleC))

#  +  相加
#  * 复制
tupleF = tupleC*3
print(tupleF)
# in
print('a' in tupleF)
print(180 in dictA)